<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>1231</div>
</body>
</html>
<script>
    const list = [
        {id: 1, name: '哈利波特1'},
        {id: 2, name: '哈利波特2'},
        {id: 3, name: '哈利波特3'},
    ]

    const arr = [1, 3]

    const lists = list.filter(item => arr.includes(item.id))
    console.log(lists)
</script>
